<template>
	<view>
		<view class="message-item" @click="goDetail(item.通知id)" v-for="item in noticeList" :key="item['通知id']">
			<view class="item-left">
				<image src="/static/icon/bell.png"></image>
			</view>
			<view class="item-right">
				<view class="right-top">
					<view class="title">{{item['标题']}}</view>
					
					<!-- <text class="time">{{item['创建时间'] | formatTime}}</text> -->
				</view>
				<view class="content">{{item['内容']}}</view>
				<view class="bottom">
					<text style="color: #666">{{item['创建时间'] | formatTime}}</text>
					<text v-if="item['是否已读']" style="color: #43CC46">已读</text>
					<text v-else style="color: #999;">未读</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			noticeList: {
				type: Array,
				default: () => []
			}
		},
		name: "noticeList",
		data() {
			return {
				
			};
		},
		methods: {
			goDetail(id) {
				uni.navigateTo({
					url: '/fireGridCheck/noticeDetail/noticeDetail?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.message-item {
		width: 710rpx;
		height: 172rpx;
		margin: 20rpx 0 0 20rpx;
		box-shadow: 0px 1rpx 4rpx 0px rgba(204, 204, 204, 0.5);
		background-color: #FFFFFF;
		border-radius: 4rpx;
		display: flex;
		.item-left {
			width: 80rpx;
			height: 80rpx;
			margin: 20rpx;
			image {
				width: 100%;
				height: 100%;
			}
		}
		.item-right {
			// flex: 1;
			width: 560rpx;
			padding-top: 16rpx;
			.right-top {
				margin-bottom: 10rpx;
				.title {
					color: #333;
					font-size: 30rpx;
					width: 18em;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					// margin-right: 175rpx;
					font-weight: bold;
				}
			}
			.bottom {
				display: flex;
				justify-content: space-between;
				padding-right: 30rpx;
				font-size: 28rpx;
			}
			.content {
				width: 20em;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				font-size: 28rpx;
				color: #666;
				margin-bottom: 10rpx;
			}
		}
	}
</style>
